let arr = [1, 2, 3, 4, 5];
// let res = arr.forEach((item, index) => {
//   arr[index] = item * 2;
// });
let res1 = arr.map((item, index) => {
  item = item * 2;
  return item * 2;
});
console.log(arr);
console.log(res1);
